/* Function Definition */

#include <stdio.h>
#include <string.h>
#include "tsminc.h"

#define EXTERN extern

#include "global.h"

dsInt16_t dsmGetRCMsg (dsUint32_t dsmHandle, dsInt16_t dsmRC)
{
    memset(RCMsg,0,DSM_MAX_RC_MSG_LENGTH+1);
    return dsmRCMsg(dsmHandle, dsmRC, RCMsg);
}



dsInt16_t dsmGetNextQMCObj (dsUint32_t dsmHandle, qryRespMCData *buff)
{
        /*
         * Blanqueo de las estructuras
         */

        memset(&qData, 0, sizeof(DataBlk));
        memset(buff  , 0, sizeof(qryRespMCData));
        /*
         * Version de la estructuras:  qData y qryRespMCDetailData
         */


        qData.stVersion = DataBlkVersion;
        buff->stVersion = qryMCDataVersion;

        qData.bufferLen = sizeof(qryRespMCData);
        qData.numBytes  = 0;
        qData.bufferPtr = (dsmQueryBuff *)buff;

        return dsmGetNextQObj(dsmHandle,&qData);
}

dsInt16_t dsmGetNextQArchiveObj (dsUint32_t dsmHandle, qryRespArchiveData *buff)
{
        /*
         * Blanqueo de las estructuras
         */

        memset(&qData, 0, sizeof(DataBlk));
        memset(buff  , 0, sizeof(qryRespArchiveData));

        /*
         * Version de la estructuras:  qData y qryRespMCDetailData
         */

        qData.stVersion = DataBlkVersion;
        buff->stVersion = qryRespArchiveDataVersion;

        qData.bufferLen = sizeof(qryRespArchiveData);
        qData.numBytes  = 0;
        qData.bufferPtr = (dsmQueryBuff *)buff;

        return dsmGetNextQObj(dsmHandle,&qData);
}

dsInt16_t dsmGetNextQFSObj(dsUint32_t dsmHandle, qryRespFSData *buff)
{
        /*
         * Blanqueo de las estructuras
         */

        memset(&qData, 0, sizeof(DataBlk));
        memset(buff  , 0, sizeof(qryRespFSData));


        /*
         * Version de la estructuras:  qData y qryRespMCDetailData
         */

        qData.stVersion = DataBlkVersion;
	buff->stVersion = qryFSDataVersion;

        qData.bufferLen = sizeof(qryRespFSData);
        qData.numBytes  = 0;
        qData.bufferPtr = (dsmQueryBuff *)buff;

        return dsmGetNextQObj(dsmHandle,&qData);
}

dsInt16_t dsmBeginQueryFS (dsUint32_t dsmHandle, qryFSData *queryBuff)
{
        queryBuff->stVersion = qryFSDataVersion;

        QueryType = qtFilespace;

        return dsmBeginQuery(dsmHandle, qtFilespace, (dsmQueryBuff *)queryBuff);

}

dsInt16_t dsmBeginQueryMC (dsUint32_t dsmHandle, qryMCData *queryBuff)
{
        queryBuff->stVersion = qryMCDataVersion;

        QueryType = qtMC;

        return dsmBeginQuery(dsmHandle, qtMC, (dsmQueryBuff *)queryBuff);
}


dsInt16_t dsmBeginQueryArchive( dsUint32_t dsmHandle, qryArchiveData *queryBuff)
{
        queryBuff->stVersion = qryArchiveDataVersion;

        QueryType = qtArchive;

        return dsmBeginQuery(dsmHandle, qtArchive, (dsmQueryBuff *)queryBuff);
}





